import fileinput
from dateutil import parser

symbol = 'NEO-USDT'

for line in fileinput.input():
  if line.find(symbol) == -1:
    continue

  if line.find('[2] FILL') >= 0:
    a = line.split(' ')
    date = parser.parse('%s %s' % (a[5], a[6]))
    # Bitfinex fill
    if line.find('BUY') >= 0:
      mark = 'bf-buy'
    else:
      mark = 'bf-sell'
    price = float(line.split('@')[1])
    print('%s\t%s\t%s' % (date, mark, price))
  elif line.find('[1]') >= 0:
    a = line.split(' ')
    date = parser.parse('%s %s' % (a[5], a[6]))
    # Binance agg
    if line.find('BUY') >= 0:
      mark = 'bn-buy'
    else:
      mark = 'bn-sell'
    price = float(line.split('@')[1])
    print('%s\t%s\t%s' % (date, mark, price))
